/*
 * Created: 2022-08-27 10:27:58
 * Author : 涛涛涛
 * 发行相关
 */

import React, { FC, useContext } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { ProductExhibitionContext } from '../ProductExhibitionContext';
import Wireframe from '@/pages/ProductExhibition/components/Wireframe/Wireframe';
import FinishTime from './FinishTime/FinishTime';
import Buy from './Buy/Buy';
export interface IProps extends ICompProps {}
Launch.defaultProps = {} as Partial<IProps>;
function Launch(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('Launch', className);
    const {
        product: { status },
    } = useContext(ProductExhibitionContext);
    return (
        <RootView className={localClassName} style={style}>
            <Wireframe head={status === 'waitForSale' && <FinishTime></FinishTime>} body={<Buy></Buy>} />
        </RootView>
    );
}
export default React.memo(Launch as FC<IProps>);
const RootView = styled(View)`
    &.Launch {
        margin-top: 60px;
    }
`;
